package com.chaopei.day38.utils;

import java.util.concurrent.ExecutorService;
import java.util.concurrent.Executors;

/**
 * @Author Corday 天涯
 * @Date 2022/4/22 16:55
 */
public class ThreadTools {//并发执行请求
//    创建线程池对象,解决高并发问题,用于存放多个线程对象
    private   static  final ExecutorService es = Executors.newFixedThreadPool(6);
    public  static  void execute(Runnable runnable){
        //启动子线程,并将其放入池中
        es.execute(runnable);
    }

}
